<?php
namespace Core\CoreComponents\AccountingManager;

/**
* This interface provide all accessible methods on operation module
*
* @method ServiceResponse getOperations($accountId, $startDate, $endDate)
* @method ServiceResponse getOperation($id)
* @method ServiceResponse addOperation($accountId, $label, $type, $status, $paymentMean, $category, $expectedamount, $operationdate, $isRecurring, $realamount = null)
* @method ServiceResponse updateOperation($id, $label, $type, $status, $paymentMean, $category, $expectedamount, $realamount, $operationdate, $isRecurring)
* @method ServiceResponse deleteOperation($id)
* @method ServiceResponse attachBill($operation)
*/
interface IOperations
{
	/**
	 * Get all operations from an account
	 * 
	 * @param integer $accountId The account id targeted
	 * @param datetime $startDate The start date to retrieve operations
	 * @param datetime $endDate The end date to retrieve operations
	 *
	 * @return ServiceResponse A service response which contains all operation between $startDate and $endDate provided
	 */
    public function getOperations($accountId, $startDate, $endDate);
	
	/**
	 * Get an operation by his Id
	 *
	 * @param integer $id The account id targeted
	 *
	 * @return ServiceResponse A service response which return the operation
	 */
    public function getOperation($id);
	
	/**
	 * Add an operation
	 *
	 * @param integer $accountId The account id targeted
	 * @param string $label The label description
	 * @param integer $type The operation type Credit / Debit.
	 * @param integer $status The operation status
	 * @param integer $paymentMean The operation payment mean
	 * @param Category $category The impacted category 
	 * @param float $expectedamount The expected amount
	 * @param datetime $operationdate The operation date performed on account
	 * @param boolean $isRecurring Is the operation recurring ?
	 * @param float $realamount The real amount performed on the account. This is an optional parameter, for rejected operation case
	 *
	 * @return ServiceResponse A service response which return with the added operation
	 */
	public function addOperation($accountId, $label, $type, $status, $paymentMean, $category, $expectedamount, $operationdate, $isRecurring, $realamount = null);
	
	/**
	 * Update an operation
	 *
	 * @param integer $id The operation id targeted
	 * @param string $label The label description
	 * @param integer $type The operation type Credit / Debit.
	 * @param integer $status The operation status
	 * @param integer $paymentMean The operation payment mean
	 * @param Category $category The impacted category 
	 * @param float $expectedamount The expected amount
	 * @param float $realamount The real amount performed on the account
	 * @param datetime $operationdate The operation date performed on account
	 * @param boolean $isRecurring Is the operation recurring ?
	 *
	 * @return ServiceResponse A service response which return with the updated operation
	 */
	public function updateOperation($id, $label, $type, $status, $paymentMean, $category, $expectedamount, $realamount, $operationdate, $isRecurring);
	
	/**
	 * Delete an operation
	 *
	 * @param integer $id The operation id targeted
	 * 
	 * @return ServiceResponse The response contains the deleted operation
	 */
    public function deleteOperation($id);
	
	/**
	 * Attach a bill to an operation
	 * 
	 * @param Operation $operation The operation id targeted
	 *
	 * @return ServiceResponse The response contains the modified operation
	 */
	public function attachBill($operation);

}

?> 